package cn.seecoder.courselearning.controller.reply;


import cn.seecoder.courselearning.service.reply.ReplyService;
import cn.seecoder.courselearning.vo.ResultVO;
import cn.seecoder.courselearning.vo.reply.ReplyVO;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/reply")
public class ReplyController {
    @Resource
    private ReplyService replyService;

    @PostMapping("/createcComment")
    public ResultVO<ReplyVO> createComment(@RequestBody ReplyVO replyVO) {
        return replyService.createComment(replyVO);
    }

    @PostMapping("/createcReply")
    public ResultVO<ReplyVO> createReply(@RequestBody ReplyVO replyVO) {
        return replyService.createReply(replyVO);
    }

    @GetMapping("/commentNews")
    public List<Integer> getCommentNews(@RequestParam Integer userId,@RequestParam Integer lastMaxId){
        return replyService.getCommentNews(userId,lastMaxId);
    }
    @GetMapping("/replyNews")
    public List<Integer> getReplyNews(@RequestParam Integer userId,@RequestParam Integer lastMaxId){
        return replyService.getReplyNews(userId,lastMaxId);
    }
}
